Run Length Encoding (RLE) is an encoding method that can be used to compress data by reducing an associated count of symbols, which is achieved by separately delivering consecutive runs of the symbols (see reference [1]). Moreover, Split RLE or SRLE (see reference [2]) is a version of RLE that can be used to deliver and compress the symbols and the consecutive runs of the symbols separately.
There are multiple different implementations of RLE that are contemporarily available. As an example, in some implementations, consecutive runs can be delivered for all different symbols. In other implementations, the consecutive runs are delivered only when there are at least two similar symbols in a symbol stream.
Furthermore, ZRLE (see reference [3]) is one special version of RLE that separately delivers non-zero values, and runs of zero values before non-zero values. ZRLE is an efficient method when given data contains a lot of zero values. ZRLE is used, for example, when quantized Discrete Cosine Transform (DCT) coefficients are compressed in Joint Photographic Experts Group (JPEG) compression.
The aforementioned RLE and SRLE can be used for bits, numbers or symbols, whereas ZRLE can be used only for numbers.
RLE and SRLE are efficient methods only in a case where there are a lot of consecutive symbols in the data, but none of those symbols is a dominant symbol. ZRLE is an efficient method only when “zero” is a dominant value in the data.
Unfortunately, when JPEG uses the ZRLE method, zero is not always the dominant value, especially when a desired quality is high and a quantization rate is low. This makes the ZRLE method very inefficient to use in such circumstances.
Therefore, there exists a need for alternative encoding methods that address shortcomings associated with known methods of encoding data, for example as aforementioned. These shortcomings relate, for example, to a degree of data compression that is achievable.
In a published article “Thinh Nguyen: “Lecture 7: Run-Length, Golomb, and Tunstall Codes”, there is described a general binary Run-Length Encoding, wherein only one stream, namely runs of Zero values, is generated.